Committing the Queue

If the default callback function is going to be called during the queue commitment, the context for it must be initialized using the SetupInitDefaultQueueCallbackXJWK5Z or SetupInitDefaultQueueCallbackEx3T..3. functions. If you are using a custom callback function that never calls the default callback function, this step is not necessary.

PVOID Context;          \\variable to store the context returned

 

                        \\initialize the context

Context = SetupInitDefaultQueueCallback( OwnerWindow );

 

In the example, OwnerWindow is the handle to the window that is to become the parent window of any dialog boxes that the default callback function generates.

After the queue is built and the callback function that will process queue notifications has been initialized, you can call SetupCommitFileQueue1ADS_1C to commit the operations that have been enqueued.

The following example uses SetupCommitFileQueue to commit the queue using the default callback routine.

test = SetupCommitFileQueue (

     OwnerWindow,          //window that will own dialog boxes

                           //created by the callback routine

     MyQueue,              //the queue to commit

 

                           //use the default callback routine
     SetupDefaultQueueCallback  

 

     Context               //context information that will be
                           //  used by the callback routine

);

 

In the preceding example, MyQueue is the queue to commit, OwnerWindow is the window that will own any dialog boxes created by the default callback routine, SetupDefaultQueueCallback specifies that the default callback function will be used, and Context is a pointer to the structure returned by the previous call to SetupInitDefaultQueueCallbackXJWK5Z.